package com.zxy.service;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;
import org.springframework.stereotype.Service;

public class Test1Service implements InitializingBean {

    @Autowired
    ThreadHandle threadHandle;

    static final Logger logger = LoggerFactory.getLogger( Test1Service.class);

    @Override
    public void afterPropertiesSet() throws Exception {
        System.out.println("------------------ afterPropertiesSet --------------------");
        Thread t = new Thread(threadHandle);
        t.start();
    }

    public Test1Service(){
        System.out.println(" -------------------- init TestService -------------- ");
        Thread t = new Thread(threadHandle);
        t.start();
    }

}
